let num = 0

function x(val) {
  let res = ''
  for (let i in val) {
    if (i == 5) {
      res = i
    } else {
      num ++
    }
  }

  return res
}

let lll = x(10)

console.log(x(10));